﻿Public Class Main_CTRL


    Private _EDM As AniFormEntities
    Private Shared _instance As Main_CTRL
    Private _vetoIdentifie As Veterinaires

    Public Event loginChanged(ByVal sender As Object, ByVal e As EventArgs)

#Region "Cycle de vie du MAIN controleur "

    Public Sub New()
        _instance = Me
        _EDM = New AniFormEntities
        '_vetoIdentifie = New Veterinaires
    End Sub

#End Region

    Public Shared ReadOnly Property getInstance() As Main_CTRL
        Get
            Return _instance
        End Get
    End Property

    Public Function getRelance_CTRL() As Relance_CTRL
        Return New Relance_CTRL(_EDM)
    End Function

    Public Function getStockVaccins_CTRL()
        Return New StockVaccins_CTRL(_EDM)
    End Function

    Public Function GetAgenda_CTRL() As Agenda_CTRL
        Return New Agenda_CTRL(_EDM)
    End Function

    Public Function getRendezVous_CTRL() As RendezVous_CTRL
        Return New RendezVous_CTRL(_EDM)
    End Function

    Public Function getClient_CTRL() As Client_CTRL
        Return New Client_CTRL(_EDM)
    End Function

    Public Function getAnimaux_CTRL(ByVal clientCourant As Clients) As Animaux_CTRL
        Return New Animaux_CTRL(_EDM, clientCourant)
    End Function

    Public Function getBaremes_CTRL() As Baremes_CTRL
        Return New Baremes_CTRL(_EDM)
    End Function

    Public Function getConsultations_CTRL(ByVal agenda As Agendas) As Consultation_CTRL
        Return New Consultation_CTRL(_EDM, agenda)
    End Function

    Public Function getVeterinaire_CTRL() As Veterinaire_CTRL
        Return New Veterinaire_CTRL(_EDM)
    End Function

    Public Function getChoixDossierMedical_CTRL() As ChoixDossierMedical_CTRL
        Return New ChoixDossierMedical_CTRL(_EDM)
    End Function

    Public Function getDossierMedical_CTRL(ByVal animal As Animaux) As DossierMedical_CTRL
        Return New DossierMedical_CTRL(_EDM, animal)
    End Function

    Public Property vetoIdentifie() As Veterinaires
        Get
            Return _vetoIdentifie
        End Get
        Set(ByVal value As Veterinaires)
            _vetoIdentifie = value
            RaiseEvent loginChanged(Me, New EventArgs)
        End Set
    End Property


End Class
